#! /usr/bin/python
# coding: utf-8

from Tkinter import *

root = Tk()

t = Text(root)

t.tag_config('a', foreground='red')
t.tag_config('b', foreground='blue')

t.insert(1.0, 'xxxxxxxx', ('b', 'a'))

t.pack()

root.mainloop()
